<template>
	<view>
		<view class="hospital-news">
			<view class="news-title">
				就医指南
			</view>
			<view style="width: 100%; height: 3px; background-color: #eee;
			">

			</view>

			<view class="hospital-news-main">
				<view class="hospital-news-item" v-for="(item,index) in newlists" :key="item.id"
					@click="tomessage(index)">
					<image :src="item.picUrl" mode=""></image>
					<view class="news-must-title">
						<view class="title">
							{{item.title}}
						</view>
						<view class="time">
							{{item.updateTime}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		youknow
	} from "./youmustknow.js"
	export default {
		data() {
			return {
				newlists: ""
			}
		},
		methods: {
			tomessage(index) {
				console.log(youknow.data.recordList[index]);
				this.newlists = youknow.data.recordList[index].content
				uni.navigateTo({
					url: `../NewsMessage/NewsMessage?mess=${index}`
				})

			}
		},
		onLoad() {
			console.log(youknow.data.recordList);
			this.newlists = youknow.data.recordList
		}
	}
</script>

<style lang="scss">
	.hospital-news {
		padding: 20px 16px;
		background-color: #f8f8f8;

		.news-title {
			width: 100%;
			text-align: center;
			color: #7fd2c1;
			font-weight: 600;
			margin-bottom: 5px;
		}

		.hospital-news-main {
			margin-top: 20px;

			.hospital-news-item {
				display: flex;
				background-color: #fff;
				overflow: hidden;
				border-radius: 15px;
				padding: 5px 0;
				margin-bottom: 16px;
				

				// justify-content: space-between;
				.news-must-title {
					.title {
						font-size: 18px;
						font-weight: 600;
						margin-top: 16px;
						margin-bottom: 40px;
					}

					.time {
						font-size: 12px;
						color: #202124;

					}
				}

				image {
					width: 100px;
					height: 90px;
					margin-right: 16px;
					margin-left: 10px;

				}
			}
		}
	}
</style>